package com.mj.mes.socket;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class SocketClient {
    private final Logger log = LoggerFactory.getLogger(SocketServer.class);


    @Async("SorcketClient")
    public void TorqueGunListener(Object torqueGun) {
        while (true) {
            try {
                Thread.sleep(SocketConfig.ReTry_Interval_Time);
//                if (torqueGun.getAvailable() == 1) {
//                    log.debug("TorgueGun Offline {} ", torqueGun.toString());
//                    dop.disconnect();
//                    return;
//                }
                log.debug("TorgueGun  Online Try... {} ", torqueGun.toString());
//                dop.connect();
            } catch (Exception ex) {
                log.error("Failed Connect to Because of :{}", ex);
            }
        }
    }
}
